:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c7ae0;
    --accent-color: #ff6b6b;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #212529;
    --light-text: #f8f9fa;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeIn 1s ease-out;
}

p.subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    animation: slideUp 1s ease-out 0.3s both;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 1s ease-out 0.5s both;
}

.drop-area-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.drop-area {
    flex: 1;
    min-width: 300px;
    height: 300px;
    border: 3px dashed #ced4da;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: var(--transition);
    background-color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.drop-area:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.drop-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(74, 107, 255, 0.05);
}

.drop-area.has-image {
    border-style: solid;
    border-color: var(--primary-color);
}

.drop-area svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    fill: #adb5bd;
    transition: var(--transition);
}

.drop-area:hover svg {
    fill: var(--primary-color);
    transform: scale(1.1);
}

.drop-area h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: #495057;
}

.drop-area p {
    text-align: center;
    color: #6c757d;
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.browse-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(74, 107, 255, 0.3);
}

.browse-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 107, 255, 0.4);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.2;
    transition: var(--transition);
}

.drop-area.has-image .preview-image {
    opacity: 1;
    z-index: 1;
}

.drop-area.has-image .drop-content {
    opacity: 0;
}

.drop-area.has-image:hover .drop-content {
    opacity: 1;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.algorithm-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-out;
}

.algorithm-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.algorithm-select {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 2px solid #ced4da;
    background-color: white;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    min-width: 180px;
}

.algorithm-select:hover, .algorithm-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.25);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.stitch-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(74, 107, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stitch-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(74, 107, 255, 0.4);
}

.stitch-btn:active {
    transform: translateY(-1px);
}

.stitch-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.stitch-btn.processing {
    background: linear-gradient(45deg, #6c757d, #495057);
    cursor: not-allowed;
}

.stitch-btn.processing svg {
    animation: spin 2s linear infinite;
}

.reset-btn {
    background-color: transparent;
    color: #6c757d;
    border: 2px solid #ced4da;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.reset-btn:hover {
    background-color: #f8f9fa;
    color: var(--text-color);
    border-color: #adb5bd;
}

.result-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out;
}

.result-container.show {
    display: flex;
}

.result-image {
    max-width: 100%;
    border-radius: calc(var(--border-radius) - 4px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.result-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.download-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.download-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.download-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(74, 107, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* UDIS2步骤显示样式 */
.udis2-steps-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.udis2-steps-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    text-align: center;
}

.udis2-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.udis2-step-item {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.udis2-step-item:hover {
    transform: translateY(-5px);
}

.udis2-step-item h4 {
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    margin: 0;
}

.udis2-step-item img {
    width: 100%;
    height: auto;
    display: block;
}

.performance-info {
    text-align: center;
    margin-top: 1rem;
    padding: 0.8rem;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    font-weight: bold;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.notification.success svg {
    color: #28a745;
}

.notification.error svg {
    color: #dc3545;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .drop-area-container {
        flex-direction: column;
    }

    .drop-area {
        min-width: 100%;
        height: 250px;
    }

    h1 {
        font-size: 2rem;
    }
}